﻿@using Abp.Extensions
@using MyCompanyName.AbpZeroTemplate.Authorization.Roles
@using MyCompanyName.AbpZeroTemplate.Web.Areas.Mpa.Models.Common.Modals
@model MyCompanyName.AbpZeroTemplate.Web.Areas.Mpa.Models.Roles.CreateOrEditRoleModalViewModel

@Html.Partial("~/Areas/Mpa/Views/Common/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(Model.IsEditMode ? (L("EditRole") + ": " + Model.Role.DisplayName) : L("CreateNewRole")))

<div class="modal-body">
    <div class="tabbable-line">
        <ul class="nav nav-tabs ">
            <li class="active">
                <a href="#RoleInformationsTab" data-toggle="tab" aria-expanded="true">
                    @L("RoleProperties")
                </a>
            </li>
            <li class="">
                <a href="#PermissionsTab" data-toggle="tab" aria-expanded="false">
                    @L("Permissions")
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="RoleInformationsTab">

                <form name="RoleInformationsForm" role="form" novalidate class="form-validation">

                    @if (Model.IsEditMode)
                    {
                        <input type="hidden" name="Id" value="@Model.Role.Id" />
                    }

                    <div class="form-group form-md-line-input form-md-floating-label">
                        <input class="form-control@(Model.Role.DisplayName.IsNullOrEmpty() ? "" : " edited")" type="text" name="DisplayName" value="@Model.Role.DisplayName" required maxlength="@Role.MaxDisplayNameLength">
                        <label>@L("RoleName")</label>
                    </div>

                    <div class="md-checkbox-list">
                        <div class="md-checkbox">
                            <input id="EditRole_IsDefault" class="md-check" type="checkbox" name="IsDefault" value="true" @Html.Raw(Model.Role.IsDefault ? "checked=\"checked\"" : "")>
                            <label for="EditRole_IsDefault">
                                <span class="inc"></span>
                                <span class="check"></span>
                                <span class="box"></span>
                                @L("Default")
                            </label>
                            <span class="help-block">@L("DefaultRole_Description")</span>
                        </div>
                    </div>

                </form>

            </div>
            <div class="tab-pane" id="PermissionsTab">
                @Html.Partial("~/Areas/Mpa/Views/Common/_PermissionTree.cshtml", Model)
            </div>
        </div>
    </div>
</div>

@Html.Partial("~/Areas/Mpa/Views/Common/Modals/_ModalFooterWithSaveAndCancel.cshtml")